﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Cataloger
{
    public partial class FrmUstawHaslo : Form
    {
        public FrmUstawHaslo()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
        private bool waliduj()
        {
            if (textBox1.Text != textBox2.Text)
                return false;
            else if (textBox1.Text == "" && textBox1.Text == textBox2.Text)
                return false;
            else
                return true;
        }
        public string Haslo
        {
            get{return this.textBox1.Text;}
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (waliduj())
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
    }
}
